﻿//-----------------------------------------------------------------------
// <copyright file="IFCISPlusClientCommunicator.cs" company="FCIS">
//     Company copyright tag.
// </copyright>
// <author>Ramy Medhat</author>
// <date>24/8/2011</date>
// <reviewer></reviewer>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FCISPlus.Server.Database;

namespace FCISPlus.Client.Communicator
{
    /// <summary>
    /// FCIS+ Client Communicator Interface
    /// </summary>
    public interface IFCISPlusClientCommunicator
    {
        /// <summary>
        /// Gets all users.
        /// </summary>
        /// <returns>Array of all users.</returns>
        FCISPlus.Server.Database.User[] GetAllUsers();

        /// <summary>
        /// Logins the specified username.
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="password">The password.</param>
        /// <returns>Boolean indicating the success of the login.</returns>
        bool Login(string username, string password);

        /// <summary>
        /// Signups the specified username.
        /// </summary>
        /// <param name="username">The username.</param>
        /// <param name="password">The password.</param>
        /// <returns>Boolean indicating the success of the singup.</returns>
        bool Signup(string username, string password);

        /// <summary>
        /// Logouts the specified username.
        /// </summary>
        void Logout();

        /// <summary>
        /// Gets the user profile.
        /// </summary>
        /// <returns>The user object.</returns>
        User GetUserProfile();

        /// <summary>
        /// Gets the feed.
        /// </summary>
        /// <returns>Array of posts from the user or his/her friends</returns>
        Post[] GetFeed();

        /// <summary>
        /// Adds the post.
        /// </summary>
        /// <param name="postText">The post text.</param>
        /// <param name="postLink">The post link.</param>
        void AddPost(string postText, string postLink);

        /// <summary>
        /// Sends the message.
        /// </summary>
        /// <param name="friend">The friend.</param>
        /// <param name="messageText">The message text.</param>
        void SendMessage(User friend, string messageText);

        /// <summary>
        /// Gets the recent conversations.
        /// </summary>
        /// <param name="messageLifeTime">The message life time.</param>
        /// <returns></returns>
        Message[] GetRecentConversations(TimeSpan messageLifeTime);

        /// <summary>
        /// Gets the conversation by friend.
        /// </summary>
        /// <param name="friend">The friend.</param>
        /// <param name="messageLifeTime">The message life time.</param>
        /// <returns></returns>
        Message[] GetConversationByFriend(User friend, TimeSpan messageLifeTime);

        /// <summary>
        /// Gets the friends.
        /// </summary>
        /// <returns></returns>
        User[] GetFriends();

        /// <summary>
        /// Adds a new friend.
        /// </summary>
        /// <returns></returns>
        void AddFriend(User user);

        /// <summary>
        /// Removes a friend.
        /// </summary>
        /// <returns></returns>
        void RemoveFriend(User user);

        /// <summary>
        /// Likes the specified post.
        /// </summary>
        /// <param name="post">The post.</param>
        void Like(Post post);

        /// <summary>
        /// Unlikes the specified post.
        /// </summary>
        /// <param name="post">The post.</param>        
        void Unlike(Post post);

    }
}
